<%@ Page Language="C#" EnableViewState="false" ValidateRequest="false" AutoEventWireup="true" Inherits="Syrinx.Gui.AspNet.Ajax.NitobiBasePage" 
	MasterPageFile="~/App_ThemeMasters/NoStyle/AdminOneColumnLayout.Master" %>

<%@ Register Assembly="Swaf.Gui.AspNet2" Namespace="Swaf.Gui.AspNet2" TagPrefix="swf" %>
<%@ Register Assembly="ScsAspNet" Namespace="Syrinx.Gui.AspNet.Ajax" TagPrefix="saj" %><%@ Register Assembly="NitobiControls" Namespace="Nitobi" TagPrefix="ntb" %>

<!--#include file="~/SiteControls/RegisterStandardControls.txt"-->
<!--#include file="../SiteControls/StandardAdminHeaderPageContent.inc"-->
<!--#include file="../SiteControls/StandardFooterPageContent.inc"-->

<script runat="server">
	public string TitleFormat = "$company.name$ - eCommerce Management";
</script>

<asp:Content ContentPlaceHolderID="title" runat="server" ID="c1">
	<%SecurityPrivilege = "AppFunctions.ManageProducts"; %>
	<h1 runat="server" ID="currencyConvertLbl" >eCommerce Management</h1>
	<div class="HelpBtnArea" style="float:right">
		<asp:HyperLink runat="server" ID="_pageHelp" NavigateUrl="../std/Help.aspx?helpid=eComManagementHelp" Target="help">Help</asp:HyperLink>
	</div>
	<swf:BizProc ID="tax" runat="server" factoryName="eComCompanyProductTaxes">
		<ParentBizProc id="loginBP" />
	</swf:BizProc>
	<swf:BizProc ID="pricing" runat="server" factoryName="eComCompanyProductQuantityDiscounts">
		<ParentBizProc id="loginBP" />
	</swf:BizProc>
	<swf:BizProc ID="codedDiscounts" runat="server" factoryName="eComCompanyProductCodedDiscounts">
		<ParentBizProc id="loginBP" />
	</swf:BizProc>
	<swf:BizProc ID="handlingFees" runat="server" factoryName="salesOrderHandlingFees">
		<ParentBizProc id="loginBP" />
	</swf:BizProc>
	<swf:BizProc ID="regionalTaxes" runat="server" factoryName="regionalTaxes">
		<ParentBizProc id="loginBP" />
	</swf:BizProc>
    <script type="text/javascript">
	function toggleTabs(cId,c1, dId){var a;for(i=1; ;i++){a = document.getElementById(cId + i);b = document.getElementById(dId + i);if(a==null || a=='')break;
	if(i==c1){a.className = 'currenttab';b.style.display = 'block';}else{a.className='';b.style.display = 'none';}}}
	</script>
</asp:Content>

<asp:Content ContentPlaceHolderID="mainContent" runat="server" ID="c3">
    <div class="tabs">
	    <ul>
	        <li id="t1" class="currenttab"><div class="firstTab"><swf:DivLayers runat="server" ID="tl1" SkinID="Tab"><asp:HyperLink runat="server" ID="_tabs1" onclick="toggleTabs('t','1','ta')" NavigateUrl="javascript:;" Text="Taxes"/></swf:DivLayers></div></li>
	        <li id="t2"><swf:DivLayers runat="server" ID="tl2" SkinID="Tab"><asp:HyperLink runat="server" ID="_tabs2" onclick="toggleTabs('t','2','ta')" NavigateUrl="javascript:;" Text="Quantity Discounts" /></swf:DivLayers></li>
	        <li id="t3"><swf:DivLayers runat="server" ID="tl3" SkinID="Tab"><asp:HyperLink runat="server" ID="_tabs3" onclick="toggleTabs('t','3','ta')" NavigateUrl="javascript:;" Text="Discount Codes" /></swf:DivLayers></li>
	        <li id="t4"><swf:DivLayers runat="server" ID="tl4" SkinID="Tab"><asp:HyperLink runat="server" ID="_tabs4" onclick="toggleTabs('t','4','ta')" NavigateUrl="javascript:;" Text="Handling Fees" /></swf:DivLayers></li>
	        <li id="t5"><div class="lastTab"><swf:DivLayers runat="server" ID="tl5" SkinID="Tab"><asp:HyperLink runat="server" ID="_tabs5" onclick="toggleTabs('t','5','ta')" NavigateUrl="javascript:;" Text="Regional Taxes" /></swf:DivLayers></div></li>
        </ul>
    </div>
	<swf:DivLayers ID="mdl1" runat="server" SkinID="MainTabArea">
    <div id="ta1">
		<saj:Grid ID="tGrid" runat="server" Width="750px" Height="250px" AllowSorting="false"  
			AllowDeleteRow="true" ShowToolbar="true"  ParentBizProcIds="tax" Mode="LiveScrolling">
			<Toolbars>
				<ntb:GridToolbar Title="ExtraInfo">
					<ntb:DeleteButtonItem Tooltip="Delete Selected Tax" />
					<ntb:RefreshButtonItem Tooltip="Refesh Tax List" />
				</ntb:GridToolbar>
			</Toolbars>
			<Columns>
				<ntb:KeyColumn DataField="id" />
				<ntb:TextColumn DataField="name" HeaderText="Tax Name" width="200" ReadOnly="false" MaxLength="35" />
				<ntb:TextColumn DataField="baseAddOn.CmpCur" HeaderText="Fixed Add On" width="100" MaxLength="10" ReadOnly="false" />
				<ntb:TextColumn DataField="percentCost" HeaderText="% of Cost" width="100" ReadOnly="false" MaxLength="3" />
				<ntb:TextColumn DataField="bizRuleCalculator" HeaderText="Calculation Rule" width="200" ReadOnly="false" MaxLength="35" />
			</Columns>
		</saj:Grid>
	</div>
	
	<div id="ta2" style="display:none">
		<saj:Grid ID="pGrid" runat="server" Width="750px" Height="250px"   AllowSorting="false"
			AllowDeleteRow="true" ShowToolbar="true" ParentBizProcIds="pricing" Mode="LiveScrolling">			
			<Toolbars>
				<ntb:GridToolbar Title="ExtraInfo">
					<ntb:DeleteButtonItem Tooltip="Delete Selected Discount" />
					<ntb:RefreshButtonItem Tooltip="Refesh Discount List" />
				</ntb:GridToolbar>
			</Toolbars>
			<Columns>
				<ntb:KeyColumn DataField="id" />
				<ntb:TextColumn DataField="name" HeaderText="Discount Name" width="200" ReadOnly="false" MaxLength="35" />
				<ntb:TextColumn DataField="quantity" HeaderText="Quantity" width="75" ReadOnly="false" MaxLength="4" />
				<ntb:TextColumn DataField="baseDiscount.CmpCur" HeaderText="Fixed Discount" width="100" ReadOnly="false" MaxLength="10" />
				<ntb:TextColumn DataField="percentCost" HeaderText="% of Cost" width="100" ReadOnly="false" MaxLength="3" />
				<ntb:TextColumn DataField="bizRuleCalculator" HeaderText="Calculation Rule" width="200" ReadOnly="false" MaxLength="35" />
			</Columns>
		</saj:Grid>
    </div>

	<div id="ta3" style="display:none">
		<saj:Grid ID="Grid1" runat="server" Width="750px" Height="250px"   AllowSorting="false"
			AllowDeleteRow="true" ShowToolbar="true" ParentBizProcIds="codedDiscounts" Mode="LiveScrolling">			
			<Toolbars>
				<ntb:GridToolbar Title="ExtraInfo">
					<ntb:DeleteButtonItem Tooltip="Delete Selected Discount" />
					<ntb:RefreshButtonItem Tooltip="Refesh Discount List" />
				</ntb:GridToolbar>
			</Toolbars>
			<Columns>
				<ntb:KeyColumn DataField="id" />
				<ntb:TextColumn DataField="name" HeaderText="Discount Name" width="200" ReadOnly="false" MaxLength="35" />
				<ntb:TextColumn DataField="code" HeaderText="Code" width="75" ReadOnly="false" MaxLength="20" />
				<ntb:TextColumn DataField="baseDiscount.CmpCur" HeaderText="Fixed Discount" width="100" ReadOnly="false" MaxLength="10" />
				<ntb:TextColumn DataField="percentCost" HeaderText="% of Cost" width="100" ReadOnly="false" MaxLength="3" />
				<ntb:TextColumn DataField="bizRuleCalculator" HeaderText="Calculation Rule" width="200" ReadOnly="false" MaxLength="35" />
			</Columns>
		</saj:Grid>
    </div>

	<div id="ta4" style="display:none">
		<saj:Grid ID="fees" runat="server" Width="750px" Height="250px"   AllowSorting="false"
			AllowDeleteRow="true" SelectionMode="Single"
			ShowToolbar="true" ParentBizProcIds="handlingFees" Mode="LiveScrolling">
			<Toolbars>
				<ntb:GridToolbar Title="ExtraInfo">
					<ntb:DeleteButtonItem Tooltip="Delete Selected Handling Fee" />
					<ntb:RefreshButtonItem Tooltip="Refesh Handling Fee List" />
				</ntb:GridToolbar>
			</Toolbars>
			<Columns>
				<ntb:KeyColumn DataField="id" />
				<ntb:ComboColumn DataField="provider.id" HeaderText="Shipping Provider" width="125" ValueField="id" DataSourceId="getCompanyDeliveryProviders" GetDataUrl="/NitobiLiveStreamHandler.aspx" ReadOnly="false">
					<ntb:BoundColumn DataField="id" Visible="false" />
					<ntb:BoundColumn DataField="name" />
				</ntb:ComboColumn>
				<ntb:TextColumn DataField="deliveryMethodName" HeaderText="Delivery Method" width="200" ReadOnly="false" MaxLength="35" />
				<ntb:TextColumn DataField="baseFee.CmpCur" HeaderText="Fixed Fee" width="100" ReadOnly="false" MaxLength="10" />
				<ntb:TextColumn DataField="percentCost" HeaderText="% of Shipping" width="100" ReadOnly="false" MaxLength="5" />
				<ntb:TextColumn DataField="bizRuleCalculator" HeaderText="Calculation Rule" width="200" ReadOnly="false" MaxLength="35" />
			</Columns>
		</saj:Grid>
    </div>

	<div id="ta5" style="display:none">
		<saj:Grid ID="Grid2" runat="server" Width="750px" Height="250px"   AllowSorting="false"
			AllowDeleteRow="true" SelectionMode="Single"
			ShowToolbar="true" ParentBizProcIds="regionalTaxes" Mode="LiveScrolling">
			<Toolbars>
				<ntb:GridToolbar Title="ExtraInfo">
					<ntb:DeleteButtonItem Tooltip="Delete Selected Regional Tax" />
					<ntb:RefreshButtonItem Tooltip="Refesh Regional Tax List" />
				</ntb:GridToolbar>
			</Toolbars>
			<Columns>
				<ntb:KeyColumn DataField="id" />
				<ntb:ComboColumn DataField="countryCode" HeaderText="Country" width="125" ValueField="regionCode" DataSourceId="getCountries" GetDataUrl="/NitobiLiveStreamHandler.aspx" ReadOnly="false">
					<ntb:BoundColumn DataField="regionCode" Visible="false" />
					<ntb:BoundColumn DataField="name" />
				</ntb:ComboColumn>
				<ntb:TextColumn DataField="stateProvince" HeaderText="State/Province" width="200" ReadOnly="false" MaxLength="10" />
				<ntb:TextColumn DataField="city" HeaderText="City" width="100" ReadOnly="false" MaxLength="50" />
				<ntb:TextColumn DataField="postalCodeInfo" HeaderText="Postal Code Range" width="200" ReadOnly="false" MaxLength="250" />
				<ntb:TextColumn DataField="percentCost" HeaderText="% of Cost" width="100" ReadOnly="false" MaxLength="3" />
			</Columns>
		</saj:Grid>
    </div>
    </swf:DivLayers>
</asp:Content>
